#include "Poco/Net/DNS.h"
#include "Poco/Net/HostEntry.h"

#include "iostream"

int main()
{
    Poco::Net::DNS::flushCache();
    //const Poco::Net::HostEntry & he = Poco::Net::DNS::hostByName("_xmpp._tcp.jabber.org");
    const Poco::Net::HostEntry & he = Poco::Net::DNS::resolve("_xmpp-client._tcp.gmail.com");
    
    //const Poco::Net::HostEntry & he = Poco::Net::DNS::hostByName("gmail.com");
    //const Poco::Net::HostEntry & he = Poco::Net::DNS::hostByName("_xmpp._tcp.boshi");

    std::cout<< he.addresses().size()<<std::endl;
    int size = he.addresses().size();
    for( int i=0; i<size; i++)
    {
        std::cout<<he.addresses()[i].toString()<< std::endl;
    }
    std::cout<<he.aliases().size()<<std::endl;
    std::cout<<he.name()<<std::endl;


    const Poco::Net::HostEntry& he2 = Poco::Net::DNS::resolve("_xmpp._tcp.jabber.org");
    std::cout<< he2.addresses().size()<<":"<<he2.addresses()[0].toString()<< std::endl;
    std::cout<<he2.aliases().size()<<std::endl;
    std::cout<<he2.name()<<std::endl;



    return 0;
}